// Copyright 2011 Jefferson Willian
// willmont7@gmail.com

#include <cstdio>

int main() {
  int value;
  int games = 1;

  while (scanf("%d", &value) && value != 0) {
    printf("Teste %d\n", games++);

    printf("%d ", value/50);
    value -= 50*(value/50);
    printf("%d ", value/10);
    value -= 10*(value/10);
    printf("%d ", value/5);
    value -= 5*(value/5);
    printf("%d\n\n", value);
  }

  return 0;
}
